﻿@page "/dock-view2/nest"
@inherits BaseDockView

<h3>@Localizer["DockViewNestTitle"]</h3>

<h4>@((MarkupString)Localizer["DockViewNestIntro"].Value)</h4>

<Select @bind-Value="@_theme"></Select>

<DockViewV2 Name="DockViewNest" Theme="_theme" class="dockview-demo">
    <DockViewContent Type="DockViewContentType.Row">
        <DockViewComponent Key="tab1" Title="标签一">
            <Table TItem="DynamicObject" DynamicContext="DataTableDynamicContext"
                   IsStriped="true" IsBordered="true" IsExcel="true" ShowRefresh="false"
                   ShowDefaultButtons="false" IsFixedHeader="true">
                <DetailRowTemplate>
                    @{
                        var detailContext = GetDetailDataTableDynamicContext(context);
                    }
                    <div class="p-2 w-100">
                        <Table TItem="DynamicObject" DynamicContext="detailContext" IsStriped="true" IsBordered="true" IsExcel="true">
                        </Table>
                    </div>
                </DetailRowTemplate>
            </Table>
        </DockViewComponent>
        <DockViewComponent Key="tab2" Title="标签二">
            <Table TItem="Foo" @bind-Items="Items"
                   IsStriped="true" IsBordered="true" IsMultipleSelect="true" IsFixedHeader="true"
                   ShowToolbar="true" ShowExtendButtons="true" ShowSkeleton="true"
                   OnAddAsync="@OnAddAsync">
                <TableColumns>
                    <TableColumn @bind-Field="@context.DateTime" Width="180" />
                    <TableColumn @bind-Field="@context.Name" />
                    <TableColumn @bind-Field="@context.Address" Width="180" TextEllipsis="true" ShowTips="true" />
                    <TableColumn @bind-Field="@context.Education" />
                    <TableColumn @bind-Field="@context.Count" />
                    <TableColumn @bind-Field="@context.Complete" />
                </TableColumns>
            </Table>
        </DockViewComponent>
        <DockViewComponent Key="tab3" Title="嵌套布局" ShowHeader="false">
            <DockViewV2 Name="DockViewInnerNest" Theme="_theme">
                <DockViewContent Type="DockViewContentType.Column">
                    <DockViewComponent Key="tab31" Title="内嵌标签一">
                        <Table TItem="TreeFoo" IsBordered="true" IsStriped="true"
                               Items="@TreeItems" IsTree="true" TreeNodeConverter="@TreeNodeConverter" OnTreeExpand="@OnTreeExpand" IsFixedHeader="true">
                            <TableColumns>
                                <TableColumn @bind-Field="@context.Name" Width="140" />
                                <TableColumn @bind-Field="@context.DateTime" Width="180" />
                                <TableColumn @bind-Field="@context.Address" Width="260" TextEllipsis="true" ShowTips="true" />
                                <TableColumn @bind-Field="@context.Count" Width="80" />
                            </TableColumns>
                        </Table>
                    </DockViewComponent>
                    <DockViewContent Type="DockViewContentType.Row">
                        <DockViewComponent Key="tab32" Title="内嵌标签二">
                            <FetchData></FetchData>
                        </DockViewComponent>
                        <DockViewComponent Key="tab33" Title="内嵌标签三">
                            <Counter></Counter>
                        </DockViewComponent>
                    </DockViewContent>
                </DockViewContent>
            </DockViewV2>
        </DockViewComponent>
    </DockViewContent>
</DockViewV2>
